
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3.1 Kafka 生产过程分析 · 大数据 Fulume 课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-solarizedlight.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="32-broker-bao-cun-xiao-xi.html" />
    
    
    <link rel="prev" href="../di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    第 1 章 Kafka 概述
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../11-xiao-xi-dui-lie.html">
            
                <a href="../11-xiao-xi-dui-lie.html">
            
                    
                    1.1 消息队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="../12-wei-shi-yao-xu-yao-xiao-xi-dui-lie.html">
            
                <a href="../12-wei-shi-yao-xu-yao-xiao-xi-dui-lie.html">
            
                    
                    1.2 为什么需要消息队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="../13-shi-yao-shi-kafka.html">
            
                <a href="../13-shi-yao-shi-kafka.html">
            
                    
                    1.3 什么是 Kafka
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4" data-path="../14-kafka-jia-gou.html">
            
                <a href="../14-kafka-jia-gou.html">
            
                    
                    1.4 Kafka 架构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1.html">
            
                <a href="../chapter1.html">
            
                    
                    第 2 章 Kafka 集群部署
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../chapter1/21-xia-zai-kafka.html">
            
                <a href="../chapter1/21-xia-zai-kafka.html">
            
                    
                    2.1 下载 Kafka
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../chapter1/22-bu-shu.html">
            
                <a href="../chapter1/22-bu-shu.html">
            
                    
                    2.2 部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../chapter1/23-kafka-chang-yong-ming-ling-cao-zuo.html">
            
                <a href="../chapter1/23-kafka-chang-yong-ming-ling-cao-zuo.html">
            
                    
                    2.3 Kafka 常用命令操作
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi.html">
            
                <a href="../di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi.html">
            
                    
                    第 3 章 Kafka 工作流程分析
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.3.1" data-path="31-kafka-sheng-cheng-guo-cheng-fen-xi.html">
            
                <a href="31-kafka-sheng-cheng-guo-cheng-fen-xi.html">
            
                    
                    3.1 Kafka 生产过程分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="32-broker-bao-cun-xiao-xi.html">
            
                <a href="32-broker-bao-cun-xiao-xi.html">
            
                    
                    3.2 broker 保存消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="33-zookeeper-cun-chu-jie-gou.html">
            
                <a href="33-zookeeper-cun-chu-jie-gou.html">
            
                    
                    3.3 Zookeeper 存储结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="34-kafka-xiao-fei-guo-cheng-fen-xi.html">
            
                <a href="34-kafka-xiao-fei-guo-cheng-fen-xi.html">
            
                    
                    3.4 Kafka 消费过程分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="35-xiao-fei-zhe-zu-an-li.html">
            
                <a href="35-xiao-fei-zhe-zu-an-li.html">
            
                    
                    3.5 消费者组案例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../di-4-zhang-api-shi-zhan.html">
            
                <a href="../di-4-zhang-api-shi-zhan.html">
            
                    
                    第 4 章 API 实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../di-4-zhang-api-shi-zhan/41-huan-jing-zhun-bei.html">
            
                <a href="../di-4-zhang-api-shi-zhan/41-huan-jing-zhun-bei.html">
            
                    
                    4.1 环境准备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../di-4-zhang-api-shi-zhan/42-kafka-sheng-chan-zhe-api.html">
            
                <a href="../di-4-zhang-api-shi-zhan/42-kafka-sheng-chan-zhe-api.html">
            
                    
                    4.2 Kafka 生产者 API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../di-4-zhang-api-shi-zhan/43-kafka-xiao-fei-zhe-api.html">
            
                <a href="../di-4-zhang-api-shi-zhan/43-kafka-xiao-fei-zhe-api.html">
            
                    
                    4.3 Kafka 消费者 API
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.3.1" data-path="../di-4-zhang-api-shi-zhan/43-kafka-xiao-fei-zhe-api/431-kafka-xiao-fei-zhe-zhi-gao-ji-api.html">
            
                <a href="../di-4-zhang-api-shi-zhan/43-kafka-xiao-fei-zhe-api/431-kafka-xiao-fei-zhe-zhi-gao-ji-api.html">
            
                    
                    4.3.1 Kafka 消费者之高级 API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2" data-path="../di-4-zhang-api-shi-zhan/43-kafka-xiao-fei-zhe-api/432-kafka-xiao-fei-zhe-zhi-di-ji-api.html">
            
                <a href="../di-4-zhang-api-shi-zhan/43-kafka-xiao-fei-zhe-api/432-kafka-xiao-fei-zhe-zhi-di-ji-api.html">
            
                    
                    4.3.2 Kafka 消费者之低级 API
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../di-5-zhang-lan-jie-qi.html">
            
                <a href="../di-5-zhang-lan-jie-qi.html">
            
                    
                    第 5 章 拦截器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../51-lan-jie-qi-yuan-li.html">
            
                <a href="../51-lan-jie-qi-yuan-li.html">
            
                    
                    5.1 拦截器原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../52-lan-jie-qi-an-li.html">
            
                <a href="../52-lan-jie-qi-an-li.html">
            
                    
                    5.2 拦截器案例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../di-6-zhang-kafka-stream.html">
            
                <a href="../di-6-zhang-kafka-stream.html">
            
                    
                    第 6 章 Kafka stream
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../di-6-zhang-kafka-stream/61-gai-shu.html">
            
                <a href="../di-6-zhang-kafka-stream/61-gai-shu.html">
            
                    
                    6.1 概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../di-6-zhang-kafka-stream/62-kafka-stream-shu-ju-qing-xi-an-li.html">
            
                <a href="../di-6-zhang-kafka-stream/62-kafka-stream-shu-ju-qing-xi-an-li.html">
            
                    
                    6.2 Kafka Stream 数据清洗案例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../di-7-zhang-kuo-zhan.html">
            
                <a href="../di-7-zhang-kuo-zhan.html">
            
                    
                    第 7 章 扩展
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../di-7-zhang-kuo-zhan/71-kafka-he-flume-ji-cheng.html">
            
                <a href="../di-7-zhang-kuo-zhan/71-kafka-he-flume-ji-cheng.html">
            
                    
                    7.1 Kafka 和 Flume 比较
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../di-7-zhang-kuo-zhan/72-kafka-he-flume-ji-cheng.html">
            
                <a href="../di-7-zhang-kuo-zhan/72-kafka-he-flume-ji-cheng.html">
            
                    
                    7.2 Kafka 和 Flume 集成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../di-7-zhang-kuo-zhan/73-kafka-pei-zhi-xin-xi.html">
            
                <a href="../di-7-zhang-kuo-zhan/73-kafka-pei-zhi-xin-xi.html">
            
                    
                    7.3 Kafka 配置信息
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.3.1" data-path="../di-7-zhang-kuo-zhan/73-kafka-pei-zhi-xin-xi/731-broker-pei-zhi-xin-xi.html">
            
                <a href="../di-7-zhang-kuo-zhan/73-kafka-pei-zhi-xin-xi/731-broker-pei-zhi-xin-xi.html">
            
                    
                    7.3.1 broker 配置信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.2" data-path="../di-7-zhang-kuo-zhan/73-kafka-pei-zhi-xin-xi/732-producer-pei-zhi-xin-xi.html">
            
                <a href="../di-7-zhang-kuo-zhan/73-kafka-pei-zhi-xin-xi/732-producer-pei-zhi-xin-xi.html">
            
                    
                    7.3.2 Producer 配置信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.3" data-path="../di-7-zhang-kuo-zhan/73-kafka-pei-zhi-xin-xi/733-consumer-pei-zhi-xin-xi.html">
            
                <a href="../di-7-zhang-kuo-zhan/73-kafka-pei-zhi-xin-xi/733-consumer-pei-zhi-xin-xi.html">
            
                    
                    7.3.3 Consumer 配置信息
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >3.1 Kafka 生产过程分析</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="31-kafka-&#x751F;&#x4EA7;&#x8FC7;&#x7A0B;&#x5206;&#x6790;">3.1 Kafka &#x751F;&#x4EA7;&#x8FC7;&#x7A0B;&#x5206;&#x6790;</h1>
<hr>
<h2 id="311-&#x5199;&#x5165;&#x65B9;&#x5F0F;">3.1.1 &#x5199;&#x5165;&#x65B9;&#x5F0F;</h2>
<p>&#x53D1;&#x9001;&#x6D88;&#x606F;&#x7684;&#x4E3B;&#x8981;&#x6B65;&#x9AA4;:</p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1541723210.png-atguiguText" alt=""></p>
<ol>
<li><p>&#x6211;&#x4EEC;&#x4ECE;&#x521B;&#x5EFA;&#x4E00;&#x4E2A; ProducerRecord &#x5BF9;&#x8C61;&#x5F00;&#x59CB;&#xFF0C; ProducerRecord &#x5BF9;&#x8C61;&#x9700;&#x8981;&#x5305;&#x542B;&#x76EE;&#x6807;&#x4E3B;&#x9898;&#x548C;&#x8981;&#x53D1;&#x9001;&#x7684;&#x5185;&#x5BB9;&#x3002; </p>
</li>
<li><p>&#x6211;&#x4EEC;&#x8FD8;&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x952E;&#x6216;&#x5206;&#x533A;&#x3002; &#x5728;&#x53D1;&#x9001; ProducerRecord &#x5BF9;&#x8C61;&#x65F6;&#xFF0C;&#x751F;&#x4EA7;&#x8005;&#x8981;&#x5148;&#x628A;&#x952E;&#x548C;&#x503C;&#x5BF9;&#x8C61;&#x5E8F;&#x5217;&#x5316;&#x6210;&#x5B57;&#x8282;&#x6570;&#x7EC4;&#xFF0C;&#x8FD9;&#x6837;&#x5B83;&#x4EEC;&#x624D;&#x80FD;&#x591F;&#x5728;&#x7F51;&#x7EDC;&#x4E0A;&#x4F20;&#x8F93;&#x3002;</p>
</li>
<li><p>&#x7136;&#x540E;&#x6570;&#x636E;&#x88AB;&#x4F20;&#x7ED9;&#x5206;&#x533A;&#x5668;&#x3002;&#x5982;&#x679C;&#x4E4B;&#x524D;&#x5728; ProducerRecord &#x5BF9;&#x8C61;&#x91CC;&#x6307;&#x5B9A;&#x4E86;&#x5206;&#x533A;&#xFF0C;&#x90A3;&#x4E48;&#x5206;&#x533A;&#x5668;&#x5C31;&#x4E0D;&#x4F1A;&#x518D;&#x505A;&#x4EFB;&#x4F55;&#x4E8B;&#x60C5;&#xFF0C;&#x76F4;&#x63A5;&#x628A;&#x6307;&#x5B9A;&#x7684;&#x5206;&#x533A;&#x8FD4;&#x56DE;&#x3002; &#x5982;&#x679C;&#x6CA1;&#x6709;&#x6307;&#x5B9A;&#x5206;&#x533A;&#xFF0C;&#x90A3;&#x4E48;&#x5206;&#x533A;&#x5668;&#x4F1A;&#x6839;&#x636E; ProducerRecord &#x5BF9;&#x8C61;&#x7684;&#x952E;&#x6765;&#x9009;&#x62E9;&#x4E00;&#x4E2A;&#x5206;&#x533A;&#x3002;</p>
</li>
<li><p>&#x9009;&#x597D;&#x5206;&#x533A;&#x4EE5;&#x540E;&#xFF0C;&#x751F;&#x4EA7;&#x8005;&#x5C31;&#x77E5;&#x9053;&#x8BE5;&#x5F80;&#x54EA;&#x4E2A;&#x4E3B;&#x9898;&#x548C;&#x5206;&#x533A;&#x53D1;&#x9001;&#x8FD9;&#x6761;&#x8BB0;&#x5F55;&#x4E86;&#x3002; &#x7D27;&#x63A5;&#x7740;&#xFF0C;&#x8FD9;&#x6761;&#x8BB0;&#x5F55;&#x88AB;&#x6DFB;&#x52A0;&#x5230;&#x4E00;&#x4E2A;&#x8BB0;&#x5F55;&#x6279;&#x6B21;&#x91CC;&#xFF0C;&#x8FD9;&#x4E2A;&#x6279;&#x6B21;&#x91CC;&#x7684;&#x6240;&#x6709;&#x6D88;&#x606F;&#x4F1A;&#x88AB;&#x53D1;&#x9001;&#x5230;&#x76F8;&#x540C;&#x7684;&#x4E3B;&#x9898;&#x548C;&#x5206;&#x533A; broker &#x4E0A;&#x3002;</p>
</li>
<li><p>&#x670D;&#x52A1;&#x5668;&#x5728;&#x6536;&#x5230;&#x8FD9;&#x4E9B;&#x6D88;&#x606F;&#x65F6;&#x4F1A;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x54CD;&#x5E94;&#x3002;&#x5982;&#x679C;&#x6D88;&#x606F;&#x6210;&#x529F;&#x5199;&#x5165; Kafka&#xFF0C;&#x5C31;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;RecordMetaData &#x5BF9;&#x8C61;&#xFF0C; &#x5B83;&#x5305;&#x542B;&#x4E86;&#x4E3B;&#x9898;&#x548C;&#x5206;&#x533A;&#x4FE1;&#x606F;&#xFF0C; &#x4EE5;&#x53CA;&#x8BB0;&#x5F55;&#x5728;&#x5206;&#x533A;&#x91CC;&#x7684;&#x504F;&#x79FB;&#x91CF;&#x3002; 
&#x5982;&#x679C;&#x5199;&#x5165;&#x5931;&#x8D25;&#xFF0C; &#x5219;&#x4F1A;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x9519;&#x8BEF;&#x3002; &#x751F;&#x4EA7;&#x8005;&#x5728;&#x6536;&#x5230;&#x9519;&#x8BEF;&#x4E4B;&#x540E;&#x4F1A;&#x5C1D;&#x8BD5;&#x91CD;&#x65B0;&#x53D1;&#x9001;&#x6D88;&#x606F;&#xFF0C;&#x51E0;&#x6B21;&#x4E4B;&#x540E;&#x5982;&#x679C;&#x8FD8;&#x662F;&#x5931;&#x8D25;&#xFF0C;&#x5C31;&#x8FD4;&#x56DE;&#x9519;&#x8BEF;&#x4FE1;&#x606F;&#x3002;</p>
</li>
<li><p>producer &#x91C7;&#x7528;&#x63A8;&#xFF08;push&#xFF09;&#x6A21;&#x5F0F;&#x5C06;&#x6D88;&#x606F;&#x53D1;&#x5E03;&#x5230; broker&#xFF0C;&#x6BCF;&#x6761;&#x6D88;&#x606F;&#x90FD;&#x88AB;&#x8FFD;&#x52A0;&#xFF08;append&#xFF09;&#x5230;&#x5206;&#x533A;&#xFF08;patition&#xFF09;&#x4E2D;&#xFF0C;&#x5C5E;&#x4E8E;&#x987A;&#x5E8F;&#x5199;&#x78C1;&#x76D8;&#xFF08;&#x987A;&#x5E8F;&#x5199;&#x78C1;&#x76D8;&#x6548;&#x7387;&#x6BD4;&#x968F;&#x673A;&#x5199;&#x5185;&#x5B58;&#x8981;&#x9AD8;&#xFF0C;&#x4FDD;&#x969C;kafka&#x541E;&#x5410;&#x7387;&#x3002;</p>
</li>
</ol>
<hr>
<h2 id="312-&#x5206;&#x533A;partition">3.1.2 &#x5206;&#x533A;(partition)</h2>
<p>&#x6D88;&#x606F;&#x53D1;&#x9001;&#x65F6;&#x90FD;&#x88AB;&#x53D1;&#x9001;&#x5230;&#x4E00;&#x4E2A; topic&#xFF0C;&#x5176;&#x672C;&#x8D28;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x76EE;&#x5F55;&#xFF0C;&#x800C; topic &#x662F;&#x7531;&#x4E00;&#x4E9B;Partition Logs(&#x5206;&#x533A;&#x65E5;&#x5FD7;)&#x7EC4;&#x6210;&#xFF0C;&#x5176;&#x7EC4;&#x7EC7;&#x7ED3;&#x6784;&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#xFF1A;</p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1541724231.png-atguiguText" alt=""></p>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C;&#x6BCF;&#x4E2A; Partition &#x4E2D;&#x7684;&#x6D88;&#x606F;&#x90FD;&#x662F;&#x6709;&#x5E8F;&#x7684;&#xFF0C;&#x751F;&#x4EA7;&#x7684;&#x6D88;&#x606F;&#x88AB;&#x4E0D;&#x65AD;&#x8FFD;&#x52A0;&#x5230;Partition log &#x4E0A;&#xFF0C;&#x5176;&#x4E2D;&#x7684;&#x6BCF;&#x4E00;&#x4E2A;&#x6D88;&#x606F;&#x90FD;&#x88AB;&#x8D4B;&#x4E88;&#x4E86;&#x4E00;&#x4E2A;&#x552F;&#x4E00;&#x7684; offset &#x503C;&#x3002;</p>
<h3 id="3121-&#x5206;&#x533A;&#x7684;&#x539F;&#x56E0;">3.1.2.1 &#x5206;&#x533A;&#x7684;&#x539F;&#x56E0;</h3>
<ol>
<li><p>&#x65B9;&#x4FBF;&#x5728;&#x96C6;&#x7FA4;&#x4E2D;&#x6269;&#x5C55;&#xFF0C;&#x6BCF;&#x4E2A; Partition &#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x8C03;&#x6574;&#x4EE5;&#x9002;&#x5E94;&#x5B83;&#x6240;&#x5728;&#x7684;&#x673A;&#x5668;&#xFF0C;&#x800C;&#x4E00;&#x4E2A;topic &#x53C8;&#x53EF;&#x4EE5;&#x6709;&#x591A;&#x4E2A; Partition &#x7EC4;&#x6210;&#xFF0C;&#x56E0;&#x6B64;&#x6574;&#x4E2A;&#x96C6;&#x7FA4;&#x5C31;&#x53EF;&#x4EE5;&#x9002;&#x5E94;&#x4EFB;&#x610F;&#x5927;&#x5C0F;&#x7684;&#x6570;&#x636E;&#x4E86;&#xFF1B;</p>
</li>
<li><p>&#x53EF;&#x4EE5;&#x63D0;&#x9AD8;&#x5E76;&#x53D1;&#xFF0C;&#x56E0;&#x4E3A;&#x53EF;&#x4EE5;&#x4EE5; Partition &#x4E3A;&#x5355;&#x4F4D;&#x8BFB;&#x5199;&#x4E86;&#x3002;</p>
</li>
</ol>
<h3 id="3122-&#x5206;&#x533A;&#x7684;&#x539F;&#x5219;">3.1.2.2 &#x5206;&#x533A;&#x7684;&#x539F;&#x5219;</h3>
<ol>
<li><p>&#x6307;&#x5B9A;&#x4E86; patition&#xFF0C;&#x5219;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#xFF1B;</p>
</li>
<li><p>&#x672A;&#x6307;&#x5B9A; patition &#x4F46;&#x6307;&#x5B9A; key&#xFF0C;&#x901A;&#x8FC7;&#x5BF9; key &#x7684; value &#x8FDB;&#x884C; hash &#x51FA;&#x4E00;&#x4E2A;patition&#xFF1B;</p>
</li>
<li><p>patition &#x548C; key &#x90FD;&#x672A;&#x6307;&#x5B9A;&#xFF0C;&#x4F7F;&#x7528;&#x8F6E;&#x8BE2;&#x9009;&#x51FA;&#x4E00;&#x4E2A; patition&#x3002;</p>
</li>
</ol>
<blockquote>
<p><code>KafakProducer</code></p>
</blockquote>
<pre class="language-"><code class="lang-java"><span class="token keyword">private</span> <span class="token keyword">int</span> <span class="token function">partition</span><span class="token punctuation">(</span>ProducerRecord<span class="token operator">&lt;</span>K<span class="token punctuation">,</span> V<span class="token operator">&gt;</span> record<span class="token punctuation">,</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> serializedKey<span class="token punctuation">,</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> serializedValue<span class="token punctuation">,</span> Cluster cluster<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    Integer partition <span class="token operator">=</span> record<span class="token punctuation">.</span><span class="token function">partition</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> partition <span class="token operator">!=</span> null <span class="token operator">?</span>
            partition <span class="token operator">:</span>
            partitioner<span class="token punctuation">.</span><span class="token function">partition</span><span class="token punctuation">(</span>
                    record<span class="token punctuation">.</span><span class="token function">topic</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> record<span class="token punctuation">.</span><span class="token function">key</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> serializedKey<span class="token punctuation">,</span> record<span class="token punctuation">.</span><span class="token function">value</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> serializedValue<span class="token punctuation">,</span> cluster<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<blockquote>
<p><code>org.apache.kafka.clients.producer.internals.DefaultPartitioner</code>&#x7C7B;:</p>
<pre class="language-"><code class="lang-java"><span class="token comment" spellcheck="true">/**
 * Compute the partition for the given record.
 *
 * @param topic The topic name
 * @param key The key to partition on (or null if no key)
 * @param keyBytes serialized key to partition on (or null if no key)
 * @param value The value to partition on or null
 * @param valueBytes serialized value to partition on or null
 * @param cluster The current cluster metadata
 */</span>
<span class="token keyword">public</span> <span class="token keyword">int</span> <span class="token function">partition</span><span class="token punctuation">(</span>String topic<span class="token punctuation">,</span> Object key<span class="token punctuation">,</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> keyBytes<span class="token punctuation">,</span> Object value<span class="token punctuation">,</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> valueBytes<span class="token punctuation">,</span> Cluster cluster<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    List<span class="token operator">&lt;</span>PartitionInfo<span class="token operator">&gt;</span> partitions <span class="token operator">=</span> cluster<span class="token punctuation">.</span><span class="token function">partitionsForTopic</span><span class="token punctuation">(</span>topic<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">int</span> numPartitions <span class="token operator">=</span> partitions<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>keyBytes <span class="token operator">==</span> null<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">int</span> nextValue <span class="token operator">=</span> <span class="token function">nextValue</span><span class="token punctuation">(</span>topic<span class="token punctuation">)</span><span class="token punctuation">;</span>
        List<span class="token operator">&lt;</span>PartitionInfo<span class="token operator">&gt;</span> availablePartitions <span class="token operator">=</span> cluster<span class="token punctuation">.</span><span class="token function">availablePartitionsForTopic</span><span class="token punctuation">(</span>topic<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>availablePartitions<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">&gt;</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">int</span> part <span class="token operator">=</span> Utils<span class="token punctuation">.</span><span class="token function">toPositive</span><span class="token punctuation">(</span>nextValue<span class="token punctuation">)</span> <span class="token operator">%</span> availablePartitions<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">return</span> availablePartitions<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>part<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">partition</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
            <span class="token comment" spellcheck="true">// no partitions are available, give a non-available partition</span>
            <span class="token keyword">return</span> Utils<span class="token punctuation">.</span><span class="token function">toPositive</span><span class="token punctuation">(</span>nextValue<span class="token punctuation">)</span> <span class="token operator">%</span> numPartitions<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
        <span class="token comment" spellcheck="true">// hash the keyBytes to choose a partition</span>
        <span class="token keyword">return</span> Utils<span class="token punctuation">.</span><span class="token function">toPositive</span><span class="token punctuation">(</span>Utils<span class="token punctuation">.</span><span class="token function">murmur2</span><span class="token punctuation">(</span>keyBytes<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">%</span> numPartitions<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
</blockquote>
<hr>
<h2 id="313-replication">3.1.3 replication</h2>
<p>&#x540C;&#x4E00;&#x4E2A; partition &#x53EF;&#x80FD;&#x4F1A;&#x6709;&#x591A;&#x4E2A; replication&#xFF08;&#x5BF9;&#x5E94; server.properties &#x914D;&#x7F6E;&#x4E2D;&#x7684; default.replication.factor=N&#xFF09;&#x3002;</p>
<p>&#x6CA1;&#x6709; replication &#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x4E00;&#x65E6; broker &#x5B95;&#x673A;&#xFF0C;&#x5176;&#x4E0A;&#x6240;&#x6709; patition &#x7684;&#x6570;&#x636E;&#x90FD;&#x4E0D;&#x53EF;&#x88AB;&#x6D88;&#x8D39;&#xFF0C;&#x540C;&#x65F6; producer &#x4E5F;&#x4E0D;&#x80FD;&#x518D;&#x5C06;&#x6570;&#x636E;&#x5B58;&#x4E8E;&#x5176;&#x4E0A;&#x7684; patition&#x3002;</p>
<p>&#x5F15;&#x5165; replication &#x4E4B;&#x540E;&#xFF0C;&#x540C;&#x4E00;&#x4E2A; partition &#x53EF;&#x80FD;&#x4F1A;&#x6709;&#x591A;&#x4E2A; replication&#xFF0C;&#x800C;&#x8FD9;&#x65F6;&#x9700;&#x8981;&#x5728;&#x8FD9;&#x4E9B; replication &#x4E4B;&#x95F4;&#x9009;&#x51FA;&#x4E00;&#x4E2A;leader&#xFF0C;producer &#x548C; consumer &#x53EA;&#x4E0E;&#x8FD9;&#x4E2A;leade r&#x4EA4;&#x4E92;&#xFF0C;&#x5176;&#x5B83; replication &#x4F5C;&#x4E3A; follower &#x4ECE; leader &#x4E2D;&#x590D;&#x5236;&#x6570;&#x636E;&#x3002;</p>
<p>&#x4E00;&#x6BB5; leader &#x6302;&#x4E86;, &#x5219;&#x4F1A;&#x4ECE;&#x5176;&#x4ED6;&#x7684; follower &#x4E2D;&#x9009;&#x4E3E;&#x51FA;&#x65B0;&#x7684; leader, &#x65B0;&#x7684; leader &#x5C31;&#x4F1A;&#x627F;&#x62C5;&#x8D77;&#x8BFB;&#x5199;&#x7684;&#x804C;&#x8D23;.</p>
<p>&#x590D;&#x672C;&#x6570;&#x4E0D;&#x80FD;&#x5927;&#x4E8E; broker &#x7684;&#x6570;&#x91CF;.</p>
<hr>
<h3 id="314-&#x5199;&#x5165;&#x6D41;&#x7A0B;">3.1.4 &#x5199;&#x5165;&#x6D41;&#x7A0B;</h3>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1541725496.png-atguiguText" alt=""></p>
<ol>
<li><p>producer &#x5148;&#x4ECE; zookeeper &#x7684; &quot;/brokers/.../state&quot; &#x8282;&#x70B9;&#x627E;&#x5230;&#x8BE5;partition &#x7684; leader</p>
</li>
<li><p>producer &#x5C06;&#x6D88;&#x606F;&#x53D1;&#x9001;&#x7ED9;&#x8BE5; leader</p>
</li>
<li><p>leader &#x5C06;&#x6D88;&#x606F;&#x5199;&#x5165;&#x672C;&#x5730; log</p>
</li>
<li><p>followers &#x4ECE; leader pull &#x6D88;&#x606F;&#xFF0C;&#x5199;&#x5165;&#x672C;&#x5730; log &#x540E;&#x5411; leader &#x53D1;&#x9001; ACK</p>
</li>
<li><p>leader &#x6536;&#x5230;&#x6240;&#x6709; ISR &#x4E2D;&#x7684; replication &#x7684;ACK&#x540E;&#xFF0C;&#x589E;&#x52A0; HW&#xFF08;high watermark&#xFF0C;&#x6700;&#x540E;commit &#x7684;offset&#xFF09;&#x5E76;&#x5411; producer &#x53D1;&#x9001; ACK</p>
</li>
</ol>
<h3 id="315-acks">3.1.5 acks</h3>
<p>ack &#x662F;&#x6D88;&#x606F;&#x786E;&#x8BA4;&#x6A21;&#x5F0F;.</p>
<p>&#x4E3B;&#x8981;&#x6709; 3 &#x4E2A;&#x503C;:</p>
<ol>
<li><p><code>0</code>
&#x610F;&#x5473;&#x7740;&#x5982;&#x679C;&#x751F;&#x4EA7;&#x8005;&#x80FD;&#x591F;&#x901A;&#x8FC7;&#x7F51;&#x7EDC;&#x628A;&#x6D88;&#x606F;&#x53D1;&#x9001;&#x51FA;&#x53BB;&#xFF0C;&#x90A3;&#x4E48;&#x5C31;&#x8BA4;&#x4E3A;&#x6D88;&#x606F;&#x5DF2;&#x6210;&#x529F;&#x5199;&#x5165; Kafka&#x3002;
&#x5728;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#x8FD8; &#x662F;&#x6709;&#x53EF;&#x80FD;&#x53D1;&#x751F;&#x9519;&#x8BEF;&#xFF0C;&#x6BD4;&#x5982;&#x53D1;&#x9001;&#x7684;&#x5BF9;&#x8C61;&#x65E0;&#x6CD5;&#x88AB;&#x5E8F;&#x5217;&#x5316;&#x6216;&#x8005;&#x7F51;&#x5361;&#x53D1;&#x751F;&#x6545;&#x969C;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x5206;&#x533A;&#x79BB;&#x7EBF;&#x6216;&#x6574;&#x4E2A;&#x96C6;&#x7FA4;&#x957F;&#x65F6;&#x95F4;&#x4E0D;&#x53EF;&#x7528;&#xFF0C;&#x90A3;&#x5C31;&#x4E0D;&#x4F1A;&#x6536;&#x5230;&#x4EFB;&#x4F55;&#x9519;&#x8BEF;.</p>
<p>&#x5728; <code>acks=0</code> &#x6A21;&#x5F0F;&#x4E0B;&#x7684;&#x8FD0;&#x884C;&#x901F; &#x5EA6;&#x662F;&#x975E;&#x5E38;&#x5FEB;&#x7684;. &#x4F60;&#x53EF;&#x4EE5;&#x5F97;&#x5230;&#x60CA;&#x4EBA;&#x7684;&#x541E;&#x5410;&#x91CF;&#x548C;&#x5E26;&#x5BBD;&#x5229;&#x7528;&#x7387;,&#x4E0D;&#x8FC7;&#x5982;&#x679C;&#x9009;&#x62E9;&#x4E86;&#x8FD9;&#x79CD;&#x6A21;&#x5F0F;&#xFF0C;&#x4E00;&#x5B9A;&#x4F1A;&#x4E22;&#x5931;&#x4E00;&#x4E9B;&#x6D88;&#x606F;&#x3002;</p>
</li>
<li><p><code>1</code>
&#x610F;&#x5473;&#x82E5;&#x9996;&#x9886;&#x5728;&#x6536;&#x5230;&#x6D88;&#x606F;&#x5E76;&#x628A;&#x5B83;&#x5199;&#x5165;&#x5230;&#x5206;&#x533A;&#x6570;&#x636E;&#x6587;&#x4EF6;&#x65F6;&#x4F1A;&#x8FD4;&#x56DE;&#x786E;&#x8BA4;&#x6216;&#x9519;&#x8BEF;&#x54CD;&#x5E94;.
&#x4E0D;&#x8FC7;&#x5728;&#x8FD9;&#x4E2A;&#x6A21;&#x5F0F; &#x4E0B;&#x4ECD;&#x7136;&#x6709;&#x53EF;&#x80FD;&#x4E22;&#x5931;&#x6570;&#x636E;&#xFF0C;&#x6BD4;&#x5982;&#x6D88;&#x606F;&#x5DF2;&#x7ECF;&#x6210;&#x529F;&#x5199;&#x5165;&#x9996;&#x9886;&#xFF0C;&#x4F46;&#x5728;&#x6D88;&#x606F;&#x88AB;&#x590D;&#x5236; &#x5230;&#x8DDF;&#x968F;&#x8005;&#x526F;&#x672C;&#x4E4B;&#x524D;&#x9996;&#x9886;&#x53D1;&#x751F;&#x5D29;&#x6124;&#x3002;</p>
</li>
<li><p><code>all</code>
&#x610F;&#x5473;&#x7740;&#x9996;&#x9886;&#x5728;&#x8FD4;&#x56DE;&#x786E;&#x8BA4;&#x6216;&#x9519;&#x8BEF;&#x54CD;&#x5E94;&#x4E4B;&#x524D;&#xFF0C;&#x4F1A;&#x7B49;&#x5F85;&#x6240;&#x6709;&#x540C;&#x6B65;&#x526F;&#x672C;&#x90FD;&#x6536;&#x5230;&#x6084;&#x606F;&#x3002;
&#x8FD9;&#x662F;&#x6700;&#x4FDD;&#x9669;&#x7684;&#x505A;&#x4E00;&#x4E00;&#x751F;&#x4EA7;&#x8005;&#x4E5F;&#x4F1A;&#x4E00;&#x76F4;&#x91CD;&#x8BD5;&#x76F4;&#x5230;&#x6D88;&#x606F;&#x88AB;&#x6210;&#x529F;&#x63D0;&#x4EA4;&#x3002; 
&#x4E0D;&#x8FC7;&#x8FD9;&#x4E5F;&#x662F;&#x6700;&#x6162;&#x7684;&#x505A;&#x6CD5;&#xFF0C;&#x751F;&#x4EA7;&#x8005;&#x5728;&#x7EE7;&#x7EED;&#x53D1;&#x9001;&#x5176;&#x4ED6;&#x6D88;&#x606F;&#x4E4B;&#x524D;&#x9700;&#x8981;&#x7B49;&#x5F85;&#x6240;&#x6709;&#x526F;&#x672C;&#x90FD;&#x6536;&#x5230;&#x5F53;&#x524D;&#x7684;&#x6D88;&#x606F;&#x3002; 
&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4F7F;&#x7528;&#x5F02;&#x6B65;&#x6A21;&#x5F0F;&#x548C;&#x66F4;&#x5927;&#x7684;&#x6279;&#x6B21;&#x6765;&#x52A0;&#x5FEB;&#x901F;&#x5EA6;&#xFF0C;&#x4F46;&#x8FD9;&#x6837;&#x505A;&#x901A;&#x5E38;&#x4F1A;&#x964D;&#x4F4E;&#x541E;&#x5410;&#x91CF;&#x3002;</p>
</li>
</ol>
<hr>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-12-19 09:59:01
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi.html" class="navigation navigation-prev " aria-label="Previous page: 第 3 章 Kafka 工作流程分析">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="32-broker-bao-cun-xiao-xi.html" class="navigation navigation-next " aria-label="Next page: 3.2 broker 保存消息">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3.1 Kafka 生产过程分析","level":"1.3.1","depth":2,"next":{"title":"3.2 broker 保存消息","level":"1.3.2","depth":2,"path":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/32-broker-bao-cun-xiao-xi.md","ref":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/32-broker-bao-cun-xiao-xi.md","articles":[]},"previous":{"title":"第 3 章 Kafka 工作流程分析","level":"1.3","depth":1,"path":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi.md","ref":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi.md","articles":[{"title":"3.1 Kafka 生产过程分析","level":"1.3.1","depth":2,"path":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/31-kafka-sheng-cheng-guo-cheng-fen-xi.md","ref":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/31-kafka-sheng-cheng-guo-cheng-fen-xi.md","articles":[]},{"title":"3.2 broker 保存消息","level":"1.3.2","depth":2,"path":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/32-broker-bao-cun-xiao-xi.md","ref":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/32-broker-bao-cun-xiao-xi.md","articles":[]},{"title":"3.3 Zookeeper 存储结构","level":"1.3.3","depth":2,"path":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/33-zookeeper-cun-chu-jie-gou.md","ref":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/33-zookeeper-cun-chu-jie-gou.md","articles":[]},{"title":"3.4 Kafka 消费过程分析","level":"1.3.4","depth":2,"path":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/34-kafka-xiao-fei-guo-cheng-fen-xi.md","ref":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/34-kafka-xiao-fei-guo-cheng-fen-xi.md","articles":[]},{"title":"3.5 消费者组案例","level":"1.3.5","depth":2,"path":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/35-xiao-fei-zhe-zu-an-li.md","ref":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/35-xiao-fei-zhe-zu-an-li.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prismjs/themes/prism-solarizedlight.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/62171757.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/83394736.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3394270.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/65028582.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/20359261.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/37472401.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3355397.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"https://www.gitbook.com/@zhenchao125"},"page-toc-button":{"maxTocDepth":3,"minTocSize":2},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据 Fulume 课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"di-3-zhang-kafka-gong-zuo-liu-cheng-fen-xi/31-kafka-sheng-cheng-guo-cheng-fen-xi.md","mtime":"2018-12-19T01:59:01.319Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-25T01:42:15.294Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

